/**
 * 进入页面弹窗
 * @author xiaoxujs
 */

import { message, Modal } from "antd"
import { ModuleBody, ModuleTitleHtml } from "../../style"
import { FC } from "react";
import { useNavigate } from "react-router-dom";
import { useWindowFontSize } from "../../../../../assets/fun/Antd/configprovider";

const EnterPageModule: FC<{
    open: boolean,
    enterPageModuleData?: {
        id: string,
        name: string
    },
    setEnterPageModuleShow:React.Dispatch<React.SetStateAction<boolean>>
}> = ({
    open,
    enterPageModuleData,
    setEnterPageModuleShow
}) => {

        const navigate = useNavigate();

        const htmlTitle = () => {
            return <ModuleTitleHtml>
                <span className="iconfont home">&#xe681;</span>
                <div>点击进入</div>
            </ModuleTitleHtml>
        }

        return <Modal width={useWindowFontSize(892)} title={htmlTitle()} open={open} footer={null} onCancel={() => setEnterPageModuleShow(false)}>
            <ModuleBody>

                <div className="body-item" onClick={() => {
                    navigate('/home/remoteControl/loadingControl/parameterSettings', {
                        state: {
                            id: enterPageModuleData?.id
                        }
                    })
                }}>
                    <span className="iconfont">&#xe63e;</span>
                    <div className="text">硬件参数</div>
                </div>
                <div className="body-item" onClick={() => {
                    navigate('/home/remoteControl/loadingControl/weigingRoomPage', {
                        state: {
                            laneId:enterPageModuleData?.id,
                            poundName:enterPageModuleData?.name
                        }
                    })
                }}>
                    <span className="iconfont">&#xe601;</span>
                    <div>后台数据</div>
                </div>
                <div className="body-item" onClick={() => {
                    // navigate('/home/remoteControl/loadingControl/parameterSettings', {
                    //     state: {
                    //         id: enterPageModuleData?.id
                    //     }
                    // })
                    message.error('暂未开放')
                }}>
                    <span className="iconfont">&#xe60b;</span>
                    <div>装车可视化大屏</div>
                </div>

            </ModuleBody>
        </Modal>
    }

export default EnterPageModule;